package edu.sctu.zhengsenwen.month201506.day20150615.files;

import java.io.File;

/**
 * Created by user15 on 2015/6/15.
 */
public class RecurFile {

    public RecurFile(){

        showAll("C:\\");
    }

    private void showAll(String directory) {

        File file = new File(directory);

        if(file.isDirectory()){

            String[] list = file.list();

            for(int i=0;i<list.length;i++){

                System.out.println(directory+list[i]);

                File tempFile = new File(directory+list[i]);

                if(tempFile.isDirectory()){

                    this.showAll(directory+list[i]);
                }
            }
        }
    }


    public static void main(String[] args) {

        new RecurFile();
    }

}
